<?php
header("Content-type:text/html;charset=utf-8");
$username = $_POST["username"];
$password = $_POST["password"];
// $password = $_POST["password"];
// echo $username.''.$password;
$con = mysqli_connect("localhost", "root", "root","heisha");
if ($con) {
    // echo "连接成功";
}
// 2、执行SQL语句
// $sqlStr = "insert into student(username) values('$username','$password')";
$sqlStr = "insert into `student`( `name`, `password`) values('$username','$password')";
	
		// values('$username')";
// $result = mysqli_query($con, $sqlStr);
$result = mysqli_query($con, $sqlStr);
// echo $result;
// echo "br";
//3、关闭数据库
mysqli_close($con);
// //三、给前端响应
if ($result == 1) {
    echo "1"; //表示注册成功
} else {
    echo "0"; //表示注册失败
    echo "注册失败";
}